package com.magicmovie.service;

import com.magicmovie.dto.MovieDTO;
import com.magicmovie.entity.Movie;
import com.magicmovie.utils.QueryFilters;
import com.magicmovie.utils.data.PageModel;
import org.springframework.web.bind.annotation.*;

import java.util.List;
import java.util.Map;

@RestController
public interface MovieService {
    /**
     * 首页分类电影
     * @param indexCategoryId
     * @return
     */
    @RequestMapping(value = "/movie/findByIndexCategoty",method = RequestMethod.GET)
    List<Map<String,Object>> findByIndexCategoty(@RequestParam("indexCategoryId") Integer indexCategoryId);

    @RequestMapping(value = "/movie/findById",method = RequestMethod.GET)
    Map<String,Object> findById(@RequestParam("id") Integer id);

    @RequestMapping(value = "/movie/selectByPramaryKey", method = RequestMethod.GET)
    Movie selectByPramaryKey(@RequestParam("id") Integer id);

    @RequestMapping(value = "/movie/queryList", method = RequestMethod.POST)
    List<Map<String,Object>> queryList(@RequestBody Map<String, Object> map);
    @RequestMapping(value = "/movie/queryCount", method = RequestMethod.POST)
    Integer queryCount(@RequestBody Map<String, Object> map);

    @RequestMapping(value = "/movie/findPurchasedMovie",method = RequestMethod.GET)
    Map<String, Object> findPurchasedMovie(@RequestParam("customerId") Integer customerId, @RequestParam("pageNum")Integer pageNum, @RequestParam("pageSize") Integer pageSize );

    @RequestMapping(value = "/movie/save", method = RequestMethod.POST)
    void save(@RequestBody MovieDTO movie);

    @RequestMapping(value = "/movie/update", method = RequestMethod.POST)
    void update(@RequestBody Movie movie);

    @RequestMapping(value = "/movie/findByParams",method = RequestMethod.POST)
    Map<String,Object> findByParams(@RequestBody Map<String, Object> params, @RequestParam("pageNum") Integer pageNum, @RequestParam("pageSize") Integer pageSize);

    @RequestMapping(value = "/movie/findByHotSale",method = RequestMethod.GET)
    Map<String,Object> findByHotSale(@RequestParam("pageNum") Integer pageNum,@RequestParam("pageSize") Integer pageSize);

    @RequestMapping(value = "/movie/getByFilter",method = RequestMethod.POST)
    PageModel getByFilter(@RequestBody QueryFilters filters);

    @RequestMapping(value = "/movie/delete", method = RequestMethod.GET)
    void delete(@RequestParam("id") Integer id);

    @GetMapping("/movie/selectByPrimaryKey")
    Movie selectByPrimaryKey(@RequestParam("id") Integer id);

}
